//调用接口配置文件
import { request } from 'config/request'

// 获取推荐楼盘列表
export async function getHomeRecommendList(params) {
    return request({
        url: 'admin/homeRecommend/v2/queryList',
        method: 'POST',
        data: params
    });
};

// 获取推荐楼盘搜索列表
export async function getEstateList(params) {
    return request({
        url: 'admin/homeRecommend/estateList',
        method: 'POST',
        data: params
    });
};

//楼盘推荐创建
export async function homeRecommendCreate(params) {
    return request({
        url: 'admin/homeRecommend/v2/saveProduct',
        method: 'POST',
        data: params
    });
};

export async function homeRecommendCreateone(params) {
    return request({
        url: 'admin/homeRecommend/v2/saveActivity',
        method: 'POST',
        data: params
    });
};
export async function homeRecommendCreatetow(params) {
    return request({
        url: 'admin/homeRecommend/v2/saveNews',
        method: 'POST',
        data: params
    });
};
//楼盘推荐删除
export async function homeRecommendDelete(params) {
    return request({
        url: 'admin/homeRecommend/v2/updateSort',
        method: 'PUT',
        data: params,
        headers: {
            'Content-type': 'application/json',
          },
    });
};

// 获取推荐活动列表
export async function getHomeRecommendActivityList(params) {
    return request({
        url: 'admin/homeRecommend/v2/queryActivityList',
        method: 'POST',
        data: params
    });
};

// 获取推荐活动搜索列表
export async function getActivityList(params) {
    return request({
        url: 'admin/homeRecommend/v2/queryActivityList',
        method: 'POST',
        data: params
    });
};


// 获取推荐资讯列表
export async function getHomeRecommendNewsList(params) {
    return request({
        url: 'admin/homeRecommend/v2/queryNewsList',
        method: 'POST',
        data: params
    });
};

// 获取推荐资讯搜索列表
export async function getNewsList(params) {
    return request({
        url: 'admin/homeRecommend/newsList',
        method: 'POST',
        data: params
    });
};

//保存是否显示直播信息
export async function saveIsLive(params) {
    return request({
        url: 'admin/homeRecommend/updateLiveInfo',
        method: 'POST',
        data: params
    });
};

//获取是否显示直播信息
export async function getIsLive(params) {
    return request({
        url: 'admin/homeRecommend/getLiveInfo',
        method: 'POST',
        data: params
    });
};

//城市
export async function regionArea(params) {
    return request({
        url: `admin/address/queryAdminAddress`,
        method: 'GET',
        data: params,
    });
};
// 弹窗选择联动

export async function target(resourceType,provinceCode,cityCode,searchName) {
    return request({
        url: `admin/homeRecommend/v2/getParameters/${resourceType}/${provinceCode}/${cityCode}/${searchName}`,
        method: 'GET',
    });
};
//更改
export async function PUTLOUP(params) {
    return request({
        url: 'admin/homeRecommend/v2/updateProduct',
        method: 'PUT',
        data: params,
        headers: {
            'Content-type': 'application/json',
          },
    });
};
export async function PUTTUI(params) {
    return request({
        url: 'admin/homeRecommend/v2/updateActivity',
        method: 'PUT',
        data: params,
        headers: {
            'Content-type': 'application/json',
          },
    });
};
export async function PUTZHIX(params) {
    return request({
        url: 'admin/homeRecommend/v2/updateNews',
        method: 'PUT',
        data: params,
        headers: {
            'Content-type': 'application/json',
          },
    });
};
